/*
 *  Copyright 2003 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
/* "@(#) DDK 1.10.00.23 07-02-03 (ddk-b12)" */
/*
 *  ======== uarthw_evmdm642.h ========
 */

#ifndef UARTHW_EVMDM642_
#define UARTHW_EVMDM642_

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
    UARTHW_EVMDM642_WORD5                         = 0x00,        /* 5-bit */
    UARTHW_EVMDM642_WORD6                         = 0x01,       /* 6-bit */
    UARTHW_EVMDM642_WORD7                         = 0x02,       /* 7-bit */
    UARTHW_EVMDM642_WORD8                         = 0x03        /* 8-bit */
} UARTHW_EVMDM642_WordLen;

typedef enum {
    UARTHW_EVMDM642_STOP1                       = 0,    /* 1 stop bit */
    UARTHW_EVMDM642_STOP2                       = 1             /* 2 stop bits */
} UARTHW_EVMDM642_StopBits;

typedef enum {
    UARTHW_EVMDM642_DISABLE_PARITY      = 0x0,  /* disable parity checking */
    UARTHW_EVMDM642_ODD_PARITY          = 0x2,  /* enable odd parity */
    UARTHW_EVMDM642_EVEN_PARITY         = 0x3,  /* enable even parity */
    UARTHW_EVMDM642_MARK_PARITY         = 0x5,  /* force mark (1) parity */
    UARTHW_EVMDM642_SPACE_PARITY        = 0x7   /* force space (0) parity */
} UARTHW_EVMDM642_Parity;

typedef enum {
    UARTHW_EVMDM642_FLOW_NONE           = 0x0000,
    UARTHW_EVMDM642_FLOW_AFE_RTSCTS     = 0x0001,
    UARTHW_EVMDM642_FLOW_AFE_CTS        = 0x0002
} UARTHW_EVMDM642_FlowControl;

/* TL16C550C UART baud rates - 29.4912MHz */
typedef enum {
    UARTHW_EVMDM642_BAUD_50                     = 36864,
    UARTHW_EVMDM642_BAUD_75                     = 24576,
    UARTHW_EVMDM642_BAUD_110            = 16756,
    UARTHW_EVMDM642_BAUD_134_5          = 13704,
    UARTHW_EVMDM642_BAUD_150            = 12288,
    UARTHW_EVMDM642_BAUD_300            = 6144,
    UARTHW_EVMDM642_BAUD_600            = 3072,
    UARTHW_EVMDM642_BAUD_1200           = 1536,
    UARTHW_EVMDM642_BAUD_1800           = 1024,
    UARTHW_EVMDM642_BAUD_2000           = 922,
    UARTHW_EVMDM642_BAUD_2400           = 768,
    UARTHW_EVMDM642_BAUD_3600           = 512,
    UARTHW_EVMDM642_BAUD_4800           = 384,
    UARTHW_EVMDM642_BAUD_7200           = 256,
    UARTHW_EVMDM642_BAUD_9600           = 192,
    UARTHW_EVMDM642_BAUD_19200          = 96,
    UARTHW_EVMDM642_BAUD_38400          = 48,
    UARTHW_EVMDM642_BAUD_57600          = 32,
    UARTHW_EVMDM642_BAUD_115200         = 16,
    UARTHW_EVMDM642_BAUD_230400         = 8
} UARTHW_EVMDM642_Baud;


/* UART default attributes settings */
#define UARTHW_EVMDM642_DEFAULTATTRS  {                 \
    UARTHW_EVMDM642_FLOW_NONE,                          \
    UARTHW_EVMDM642_DISABLE_PARITY,                     \
    UARTHW_EVMDM642_WORD8,                              \
    UARTHW_EVMDM642_STOP1,                              \
    UARTHW_EVMDM642_BAUD_115200                         \
}

#define UARTHW_EVMDM642_HW_FLOW_MASK (UARTHW_EVMDM642_FLOW_AFE_CTS | \
                                 UARTHW_EVMDM642_FLOW_AFE_RTSCTS)

typedef struct UARTHW_EVMDM642_Params {
    /* Flow Control Parameters */
    UARTHW_EVMDM642_FlowControl flowControl;     
        
    /* Communication Parameters */
    UARTHW_EVMDM642_Parity      parity;
    UARTHW_EVMDM642_WordLen     wordSize;
    UARTHW_EVMDM642_StopBits    stopBits;
    UARTHW_EVMDM642_Baud        baud;
} UARTHW_EVMDM642_Params;

#ifdef __cplusplus
}
#endif /* extern "C" */

#endif /* UARTHW_EVMDM642_ */
